package io.bluerain.broadcastreceiver.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

/**
 * Created by foredawn on 15-9-13.
 * 一个简单的BroadcastReceiver实现
 */
public class MyBroadcast extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String msg = intent.getStringExtra("msg");
        Toast.makeText(context, "来自:" + intent.getAction() + "的消息:" + msg, Toast.LENGTH_SHORT).show();
    }
}
